package net.sx.minemodule.mvp.activities;

import android.os.Bundle;
import android.text.TextUtils;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.homegoods.aroutercomment.ARouterPath;
import com.kedll.library.base.MyBaseFragmentActivity;
import com.kedll.library.mvp.BasePresenter;
import com.kedll.library.util.ToastUtil;

import net.sx.minemodule.MineApiUtils;
import net.sx.minemodule.R;
import net.sx.minemodule.databinding.MineActivityMineBindingNewPhoneBinding;

/**
 * 绑定新手机号
 *
 * @author 11470
 */
@Route(path = ARouterPath.PATH_BINDING_NEW_PHONE)
public class MineBindingNewPhoneActivity extends MyBaseFragmentActivity<MineActivityMineBindingNewPhoneBinding, BasePresenter> {


    @Override
    protected int getLayout() {
        return R.layout.mine_activity_mine_binding_new_phone;
    }

    @Override
    protected void initEvent() {
        mBinding.tvBindingNewPhone.setOnClickListener(v -> {
            if (TextUtils.isEmpty(mBinding.etInputNewPhoneBinding.getText().toString().trim()) || TextUtils.isEmpty(mBinding.etInputSmsNewPhone.getText().toString().trim())) {
                return;
            }
            //del shibo.zheng test
            /*MineApiUtils.modifyUserPhoneAndPwd("MPhone", mBinding.etInputNewPhoneBinding.getText().toString(), mBinding.etInputSmsNewPhone.getText().toString(), o -> {
                ToastUtil.showToast("修改成功");
                finish();
            }, throwable -> {

            });*/
        });
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        super.initData(savedInstanceState);


    }

    @Override
    protected void initToolBar(Bundle savedInstanceState) {
        super.initToolBar(savedInstanceState);
        setTitle("绑定新手机号");
    }

    @Override
    protected BasePresenter getPresenter() {
        return null;
    }
}
